package cn.iocoder.yudao.module.written.exam.controller.app.jobcategories;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.written.exam.controller.admin.jobcategories.vo.JobCategoriesTreeReqVO;
import cn.iocoder.yudao.module.written.exam.controller.admin.jobcategories.vo.JobCategoriesTreeRespVO;
import cn.iocoder.yudao.module.written.exam.service.jobcategories.JobCategoriesService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "笔试管理（有关笔试） - 职位分类")
@RestController
@RequestMapping("/written-exam/job-categories")
@Validated
public class AppJobCategoriesController {

    @Resource
    private JobCategoriesService jobCategoriesService;

    @GetMapping("/tree")
    @Operation(summary = "获得职位分类分页")
    public CommonResult<List<JobCategoriesTreeRespVO>> getJobCategoriesTree(@Valid JobCategoriesTreeReqVO treeReqVO) {
        return success(jobCategoriesService.queryJobCategoriesTree(treeReqVO));
    }

}